<?php

include(dirname(__FILE__).'/../../bootstrap/functional.php');

$browser = new TaskTestFunctional(new sfBrowser());

$task = $browser->getMostRecentMilestoneZeroTasks();
 
$browser->info('1 - The task page')->
  get('/')-> 
  info('  1.1 - Each task on the homepage is clickable and give detailed information')->
  click('zero', array(), array('position' => 1))->
  with('request')->begin()->
    isParameter('module', 'milestone')->
    isParameter('action', 'show')->
    isParameter('milestoneid', '1')->  
  end()  
;
/*
$browser->info('2 - The task page')->
  get('/')-> 
  info('  1.2 - Each task on the homepage is clickable and give detailed information')->
  click('23', array(), array('position' => 1))->
  with('request')->begin()->
    isParameter('module', 'milestone')->
    isParameter('action', 'show')->
    isParameter('milestoneid', '1')->  
  end()  
;
*/
$browser->info('3 - Post a task page')->
  info('  3.1 - Submit a Task')->
 
  get('/task/new/')->
  with('request')->begin()->
    isParameter('module', 'task')->
    isParameter('action', 'new')->
  end()->
 
  click('Save', array('task' => array(
  
      'shortsummary'     => 'short summarry',
      'description'      => 'description',
      'milestoneid'      => '1',
      'prioritytype'     => 'medium',
      'resourceid'       => '1',
      'taskstatus'       => 'open',
  )))->
 
  with('request')->begin()->
    isParameter('module', 'task')->
    isParameter('action', 'create')->
  end()
;
//$browser->with('response')->debug();

